package net.cyndeline.itemEventFactory

import net.cyndeline.entitySystem.EntityRef

/**
 * Contains all in-data required to calculate event results from an item action.
 * Used to ease the addition of additional parameters in future releases.
 */
trait ActionInput {
  
  /**
   * Returns every entity in the input. This method should be used to
   * fetch the entities involved by any algorithm that doesn't explicitly
   * care about the status of a particular entity (i.e if it is a target, user
   * etc.) 
   */
  def allInput: Set[EntityRef]
  
  /**
   * The entity using an item, or owning the object that requires input.
   * Default should be a NULL reference if the field isn't in use.
   */
  def user: EntityRef
  
  /**
   * All entities targeted. May include the user.
   */
  def targets: List[EntityRef]
}

/**
 * Configuration setters for input data.
 */
trait ActionInputConfig extends ActionInput {
  
  /**
   * Overrides the previous user.
   */
  def user_=(newUser: EntityRef)
  
  /**
   * Overrides the previous target list with the new one.
   */
  def targets_=(newTargets: List[EntityRef])
}